import request from '@/utils/request'

export function fetchUserData() {
    return request.get('https://api.github.com/users/woai3c')
}
// users
export function getUserInfo() {
    return request.get('/users')
}

export function amendUserInfo(id, data) {
    return request.patch(`/users/${id}`, data)
}

export function removeUserInfo(id) {
    return request.delete(`/users/${id}`)
}

export function addUserInfo(data) {
    return request.post('/users', data)
}
// admins
export function getAdminInfo() {
    return request.get('/admins')
}

export function amendAdminInfo(id, data) {
    return request.patch(`/admins/${id}`, data)
}

export function removeAdminInfo(id) {
    return request.delete(`/admins/${id}`)
}

export function addAdminInfo(data) {
    return request.post('/admins', data)
}
// bikes
export function getBikeInfo() {
    return request.get('/bikes')
}

export function amendBikeInfo(id, data) {
    return request.patch(`/bikes/${id}`, data)
}

export function removeBikeInfo(id) {
    return request.delete(`/bikes/${id}`)
}

export function addBikeInfo(data) {
    return request.post('/bikes', data)
}
// complaints
export function getComplaintsInfo() {
    return request.get('/complaints')
}

export function amendComplaintsInfo(id, data) {
    return request.patch(`/complaints/${id}`, data)
}

export function removeComplaintsInfo(id) {
    return request.delete(`/complaints/${id}`)
}

export function addComplaintsInfo(data) {
    return request.post('/complaints', data)
}
// repairs
export function getRepairsInfo() {
    return request.get('/repairs')
}

export function amendRepairsInfo(id, data) {
    return request.patch(`/repairs/${id}`, data)
}

export function removeRepairsInfo(id) {
    return request.delete(`/repairs/${id}`)
}

export function addRepairsInfo(data) {
    return request.post('/repairs', data)
}
// logs
export function getLogsInfo() {
    return request.get('/logs')
}

export function amendLogsInfo(id, data) {
    return request.patch(`/logs/${id}`, data)
}

export function removeLogsInfo(id) {
    return request.delete(`/logs/${id}`)
}

export function addLogsInfo(data) {
    return request.post('/logs', data)
}
// recharges
export function getRechargesInfo() {
    return request.get('/recharges')
}

export function amendRechargesInfo(id, data) {
    return request.patch(`/recharges/${id}`, data)
}

export function removeRechargesInfo(id) {
    return request.delete(`/recharges/${id}`)
}

export function addRechargesInfo(data) {
    return request.post('/recharges', data)
}
// orders
export function getOrdersInfo() {
    return request.get('/orders')
}

export function amendOrdersInfo(id, data) {
    return request.patch(`/orders/${id}`, data)
}

export function removeOrdersInfo(id) {
    return request.delete(`/orders/${id}`)
}

export function addOrdersInfo(data) {
    return request.post('/orders', data)
}
